//package com.zdw.demo.controller;
//
//import com.zdw.common.parent.JSONResult;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.io.FileInputStream;
//import java.io.FileOutputStream;
//import java.io.IOException;
//import java.net.URI;
//import java.net.http.HttpClient;
//import java.net.http.HttpRequest;
//import java.net.http.HttpResponse;
//import java.nio.file.Files;
//import java.nio.file.Path;
//import java.nio.file.Paths;
//import java.util.List;
//import java.util.concurrent.CompletableFuture;
//import java.util.concurrent.ExecutionException;
//import java.util.random.RandomGenerator;
//import java.util.random.RandomGeneratorFactory;
//import java.util.stream.Collectors;
//
///**
// * <p>
// * 前端控制器
// * </p>
// *
// * @author 卓德文
// * @since 2022-11-21
// */
//@Slf4j
//@RestController
//@RequestMapping("/jdk17")
//@Api(value = "jdk17测试接口", tags = {"jdkApi"})
//public class Jdk17TestController {
//
//    @ApiOperation(value = "jdk17测试", consumes = "application/json;charset=UTF-8")
//    @PostMapping(value = "/testJdk17")
//    public JSONResult testJdk() throws IOException, InterruptedException, ExecutionException {
//        //特性1:switch语句
//        //1)JDK12写法(增加lambda写法)
//        String day = "FRIDAY";
//        switch (day) {
//            case "MONDAY"       -> System.out.println(1);
//            case "TUESDAY"      -> System.out.println(2);
//            case "WEDNESDAY"    -> System.out.println(3);
//            case "THURSDAY"     -> System.out.println(4);
//            case "FRIDAY"       -> System.out.println(5);
//            case "SATURDAY"     -> System.out.println(6);
//            case "SUNDAY"       -> System.out.println(7);
//            default             -> System.out.println(0);
//        }
//        //2)JDK13写法(增加返回值)
//        int ii = switch (day) {
//            case "MONDAY"       -> 1;
//            case "TUESDAY"      -> 2;
//            case "WEDNESDAY"    -> 3;
//            case "THURSDAY"     -> 4;
//            case "FRIDAY"       -> 5;
//            case "SATURDAY"     -> 6;
//            case "SUNDAY"       -> 7;
//            default             -> 0;
//        };
//        System.out.println(ii);
//        //3)JDK17写法(增加了instanceof)
//        Object obj = 10L;
//        switch (obj) {
//            case Integer i      -> System.out.println(i);
//            case Long l         -> System.out.println(l);
//            case Double d       -> System.out.println(d);
//            case String s       -> System.out.println(s);
//            default             -> System.out.println("UNKNOWN");
//        }
//
//        //2.特性2:增强型伪随机数发生器
//        //1)查询随机数算法
//        RandomGeneratorFactory.all().forEach(e -> System.out.println(e.group() + "-" + e.name()));
//        //2)生成随机数
//        RandomGeneratorFactory<RandomGenerator> L128X1024MixRandom = RandomGeneratorFactory.of("L128X1024MixRandom");
//        RandomGenerator randomGenerator = L128X1024MixRandom.create(System.currentTimeMillis());
//        for (int j = 0; j < 10; j++) {
//            System.out.println(randomGenerator.nextInt(10));
//        }
//
//        //3.特性3:sealed密封类   -   com.zdw.demo.controller.Jdk17TestController.Person
//
//        //4.特性4:strictfp严格浮点
//
//        //5.其他
//
//        return new JSONResult().markSuccess(InternationalUtils.getInternational("common.query.success"), "JDK17测试");
//    }
//
//    /**
//     * 特性3:sealed密封类
//     */
//    static sealed class Person permits Male, Female {
//    }
//
//    sealed interface Function permits Male, Female {
//        void eat();
//    }
//
//    static final class Male extends Person implements Function {
//        @Override
//        public void eat() {
//            System.out.println("eat 1");
//        }
//    }
//
//    static non-sealed class Female extends Person implements Function {
//        @Override
//        public void eat() {
//            System.out.println("eat 2");
//        }
//    }
//
//}
